package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        Person p = new Person();
        try {
            p.setAge(1000);
        } catch (IllegalAgeException e) {
            try {
                p.setAge(30);
                e.printStackTrace();
            } catch (Exception exception) {
                exception.printStackTrace();
            }
        }


        System.out.println("这个人" + p.getAge() + "岁");
    }
}
